import http from "../utils/http"
const mode = {
  //题库列表
  questionList () {
    return http.request({
      url: "twoam/skin/questionList",
      method: "POST",
      data: {},
    })
  },
  // 提交答案 生成报告
  // report (arr, userid) {
  //   return http.request({
  //     url: "twoam/skin/report",
  //     method: "POST",
  //     data: {
  //       arr: arr,
  //       user_id: userid
  //     },
  //   })
  // },
  // 提交答案 生成报告
  report (arr, userid) {
    return http.request({
      url: "twoam/skin/reportV2",
      method: "POST",
      data: {
        arr: arr,
        user_id: userid
      },
    })
  },
  // 推荐商品
  recommendGoods (data) {
    return http.request({
      url: "twoam/skin/recommendGoods",
      method: "POST",
      data: data,
    })
  },
  // 删除购物车商品
  recmoveGoods (data) {
    return http.request({
      url: "twoam/cart/rm",
      method: "POST",
      data: data,
    })
  },
  //用户肤质测试列表
  getReportList (arr) {
    return http.request({
      url: "twoam/skin/reportList",
      method: "POST",
      data: {
        user_id: arr
      },
    })
  },
  //报告详情
  getReportDetail (arr) {
    return http.request({
      url: "twoam/skin/reportDetail",
      method: "POST",
      data: {
        id: arr
      },
    })
  },
  //门店列表
  storeLists (arr) {
    return http.request({
      url: "twoam/store/lists",
      method: "POST",
      data: {
        arr: arr
      },
    })
  },
  //根据经纬度获取省市区
  itemText (arr) {
    return http.request({
      url: "twoam/item/test",
      method: "POST",
      data: arr,
    })
  },
  //获取常见问题
  getProblem () {
    return http.request({
      url: "twoam/Article/getProblem",
      method: 'POST'
    })
  },// 护肤建议推荐商品
  proposalRecommend (proposal_id) {
    return http.request({
      url: "twoam/skin/proposalRecommend",
      method: "POST",
      data: {
        proposal_id: proposal_id
      },
    })
  },
  getIntegralGoods (page, limit) {
    return http.request({
      url: "twoam/integral_goods/lists",
      method: "POST",
      data: {
        page: page,
        limit: limit
      },
    })
  },
  getIntegralDetail (id) {
    return http.request({
      url: "twoam/integral_goods/detail",
      method: "POST",
      data: {
        id: id
      },
    })
  },
  getIntegralExchange (id, good_id, receiving_info, user_id) {
    return http.request({
      url: "twoam/integral_goods/exchange",
      method: "POST",
      data: {
        id,
        good_id,
        receiving_info,
        user_id
      },
    })
  },
  getIntegralMatch (score) {
    return http.request({
      url: "twoam/integral_goods/score_match",
      method: "POST",
      data: {
        score: score
      },
    })
  },
  getOpenid (code) {
    return http.request({
      url: "twoam/user_pay/getOpenid",
      method: "POST",
      data: {
        code: code
      },
    })
  },
  goPay (openid, totalPrice) {
    return http.request({
      url: "twoam/user_pay/test",
      method: "POST",
      data: {
        openid: openid,
        totalPrice: totalPrice
      },
    })
  },
  // getChangelog (userid) {
  //   return http.request({
  //     url: "twoam/shuyun/getChangelog",
  //     method: "POST",
  //     data: {
  //       userid: userid
  //     },
  //   })
  // },
  getUserInfo (userid) {
    return http.request({
      url: "twoam/wechat/getInfo",
      method: "POST",
      data: {
        userid: userid
      },
    })
  },
  changeScore (data) {
    return http.request({
      url: "twoam/wechat/integralConfig",
      method: "POST",
      data: data,
    })
  },
  //加入购物车
  cartAdd (data) {
    return http.request({
      url: "twoam/cart/add",
      method: "POST",
      data,
    })
  },
  //购物车列表
  cartLists (data) {
    return http.request({
      url: "twoam/cart/lists",
      method: "POST",
      data,
    })
  },
  //更新购物车数量
  update_number (data) {
    return http.request({
      url: "twoam/cart/update_number",
      method: "POST",
      data,
    })
  },
  //确认订单
  confirmOrders (data) {
    return http.request({
      url: "twoam/order/confirmOrders",
      method: "POST",
      data,
    })
  },
  //创建订单
  createOrders (data) {
    return http.request({
      url: "twoam/order/createOrders",
      method: "POST",
      data,
    })
  },
  //获取地址
  getAddress (data) {
    return http.request({
      url: "twoam/wechat/getAddress",
      method: "POST",
      data,
    })
  },
  //订单可用优惠券
  getCoupon (data) {
    return http.request({
      url: "twoam/order/getCoupon",
      method: "POST",
      data,
    })
  },
  //订单支付
  orderPay (data) {
    return http.request({
      url: "twoam/user_pay/pay",
      method: "POST",
      data,
    })
  },
  //订单详情
  getOrdersInfo (data) {
    return http.request({
      url: "/twoam/order/getOrdersInfo",
      method: "POST",
      data,
    })
  },
  //订单列表
  getOrders (data) {
    return http.request({
      url: "/twoam/order/getOrders",
      method: "POST",
      data,
    })
  },
  //订单支付
  userOrderPay (data) {
    return http.request({
      url: "/twoam/userPay/pay",
      method: "POST",
      data,
    })
  },
  //取消订单
  ordersCancel (data) {
    return http.request({
      url: "/twoam/order/ordersCancel",
      method: "POST",
      data,
    })
  },
  //获取取消原因列表
  orderCancel (data) {
    return http.request({
      url: "/twoam/order/orderCancel",
      method: "POST",
      data,
    })
  },
  //修改订单收货地址
  saveOrderAddress (data) {
    return http.request({
      url: "/twoam/order/saveOrderAddress",
      method: "POST",
      data,
    })
  },
  //确认收货
  confirmOrder(data) {
    return http.request({
      url: "/twoam/order/confirm",
      method: "POST",
      data,
    })
  },
  //积分商城详情
  integralGoodsDetail(data) {
    return http.request({
      url: "/twoam/integralGoods/detail",
      method: "POST",
      data,
    })
  },
  //积分兑换
  createIntegralOrder(data) {
    return http.request({
      url: "/twoam/integralOrders/createIntegralOrder",
      method: "POST",
      data,
    })
  },
  //领取试用装
  creatTestOrder(data) {
    return http.request({
      url: "/twoam/order/experienceOrder",
      method: "POST",
      data,
    })
  },
  //领取试用装
  sureUser(data) {
    return http.request({
      url: "/twoam/user/authentication",
      method: "POST",
      data,
    })
  },
}
export default mode